﻿#undef WANT_CRT_DEBUG

#include "Platform.hpp"

#include <cstdint>
#include <iostream>
#include <string>

#include <Windows.h>

#include "Application.hpp"

//#include "Endian.hpp"

#include "Debug.hpp"

struct DataRecord
{
	uint32_t field1;
	uint32_t field2;
};

struct DataTable
{
	uint32_t endianMagic;
	uint32_t recordSize;
	uint32_t numRecords;
	DataRecord records[10];
};

static DataRecord records[] =
{
	{ 1, 2 },
	{ 3, 4 },
	{ 5, 6 },
	{ 7, 8 },
	{ 9, 10 },
	{ 11, 12 },
	{ 13, 15 },
	{ 15, 16 },
	{ 17, 18 },
	{ 19, 20 },

};

int main(void)
{
#if defined(WANT_CRT_DEBUG) && defined(_DEBUG)
	_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF|_CRTDBG_LEAK_CHECK_DF|_CRTDBG_CHECK_ALWAYS_DF);
#endif

#if 0
	TIMECAPS resolution = { 0 };
	if(::timeGetDevCaps (&resolution, sizeof(TIMECAPS)) != TIMERR_NOERROR)
		return 0;

	cout << "Minimum resolution " << resolution.wPeriodMin <<
		" Maximum resolution " << resolution.wPeriodMax << endl;

	if(::timeBeginPeriod(resolution.wPeriodMin) != TIMERR_NOERROR)
		return 0;
#endif

	CApplication* app = new CApplication(50);
	app->Run();
	delete app;

	return 0;
}
